<div class="main_content_wrapper">
	<div class="main_content_top"></div>
	<div class="main_content">
		<?php echo form_open(uri_string(), 'class="crud" id="custom_acc" ')?>
			<div class="form-element">
				<?php echo validation_errors('<div class="error">', '</div>'); ?>
				<div class="line-warp">
					<div class="form-element-left">
						<span><?php echo lang('uploking_profile_firstname_label')?>:</span>
					</div>
					<div class="form-element-right">
						<input name="first_name" type="text" value="<?php echo $user->first_name?>" maxlength="25" required placeholder="Enter user name" autofocus>
					</div>
				</div>
				<div class="line-warp">
					<div class="form-element-left">
						<span><?php echo lang('uploking_profile_lastname_label')?>:</span>
					</div>
					<div class="form-element-right">
						<input name="last_name" type="text" value="<?php echo $user->last_name?>" maxlength="25" required placeholder="Enter user name" autofocus>
					</div>
				</div>
				<div class="line-warp">
					<div class="form-element-left">
						<span><?php echo lang('uploking_profile_username_label')?>:</span>
					</div>
					<div class="form-element-right">
						<input name="username" type="text" value="<?php echo $user->username?>" readonly="readonly" maxlength="25" required placeholder="Enter user name" autofocus>
					</div>
				</div>
				<div class="line-warp">
					<div class="form-element-left">
						<span><?php echo lang('uploking_profile_password_label')?>:</span>
					</div>
					<div class="form-element-right">
						<input name="password" type="password" maxlength="25" placeholder="Enter your password" autofocus>
					</div>
				</div>
				<div class="line-warp">
					<div class="form-element-left">
						<span><?php echo lang('uploking_profile_confirm_password_label')?>:</span>
					</div>
					<div class="form-element-right">
						<input name="retype_password" type="password" maxlength="25" placeholder="Enter your password" autofocus>
					</div>
				</div>
				<div class="line-warp">
					<div class="form-element-left">
						<span><?php echo lang('uploking_profile_email_label')?>:</span>
					</div>
					<div class="form-element-right">
						<input name="email" type="text" value="<?php echo $user->email?>" readonly="readonly" maxlength="25" required placeholder="Enter your email" autofocus>
					</div>
				</div>
				<div class="line-warp">
					<div class="form-element-left">
						<span><?php echo lang('uploking_profile_account_id_label')?>:</span>
					</div>
					<div class="form-element-right">
						<span><?php echo $user->id?></span>
					</div>
				</div>
				<div class="line-warp">
					<div class="form-element-left">
						<span><?php echo lang('uploking_profile_pin_label')?>:</span>
					</div>
					<div class="form-element-right">
						<span><?php echo $user->pin?></span>
					</div>
				</div>
				<div class="line-warp">
					<div class="form-element-left">
						<span><?php echo lang('uploking_profile_account_created_on_label')?>:</span>
					</div>
					<div class="form-element-right">
						<span><?php echo format_date($user->created_time)?></span>
					</div>
				</div>
				<div class="line-warp last">
					<div class="form-element-left">
						<span><?php echo lang('uploking_profile_account_level_label')?>:</span>
					</div>
					<div class="form-element-right">
						<span>
						<?php
						if($currentPackage = getCurrentPackage($user->id)){
							echo $currentPackage->name;
						}else{
							echo lang('uploking_profile_free_label');
						}
						?>
						</span>
						
						<span><a href="#" id="buy_uploking"><?php echo lang('uploking_profile_buy_label')?></a></span>
					</div>
				</div>
				<?php
				$earnedMoney = getEarnedMoney($user->id);
				$withDrawedMoney = getWithdrawedMoney($user->id);
				?>
				<div class="line-warp">
					<div class="form-element-left">
						<span><?php echo lang('uploking_profile_earned_label')?>:</span>
					</div>
					<div class="form-element-right">
						<span>$<?php echo $earnedMoney;?></span>
					</div>
				</div>
				<div class="line-warp">
					<div class="form-element-left">
						<span><?php echo anchor('withdrawals', lang('uploking_profile_withdrawed_label'), 'id="withdrawal"')?>:</span>
					</div>
					<div class="form-element-right">
						<span>$<?php echo $withDrawedMoney?></span> <?php echo anchor('withdrawals/request', lang('uploking_withdrawal_withdrawal_label'), 'id="withdrawal-request"')?>
					</div>
				</div>
				<div class="line-warp">
					<div class="form-element-left">
						<span><?php echo lang('uploking_profile_balanced_label')?>:</span>
					</div>
					<div class="form-element-right">
						<span>$<?php echo $earnedMoney - $withDrawedMoney?></span>
					</div>
				</div>
			</div>
			
			<div id="profile_button">
				<button type=submit id="bt_save"><?php echo lang('uploking_profile_save_label')?></button><button type=reset id="bt_reset"><?php echo lang('uploking_profile_reset_label')?></button>
			</div>
		<?php echo form_close()?>
	</div>
	<div class="main_content_bottom"></div>
</div>